import { request } from '../utils/request.js'

// 我的绑卡列表
export async function mycards(params) {
	try {
		let res = await request({
			url: "/Cards/mycards",
			method: "post",
			params,
		});
		return res;
	} catch (e) {
		return { success: false };
	}
}

// 绑卡信息详情
export async function mycardsfirst(params) {
	try {
		let res = await request({
			url: "/Cards/mycardsfirst",
			method: "post",
			params,
		});
		return res;
	} catch (e) {
		return { success: false };
	}
}

// 发送绑卡短信 state=3 时允许修改，不允许使用
export async function BindCardApply(params,data) {
	try {
		let res = await request({
			url: "/Cards/BindCardApply",
			method: "post",
			params,
			data
		});
		return res;
	} catch (e) {
		return { success: false };
	}
}

// 确认绑卡
export async function ConfirmBindCard(params) {
	try {
		let res = await request({
			url: "/Cards/ConfirmBindCard",
			method: "post",
			params,
		});
		return res;
	} catch (e) {
		return { success: false };
	}
}

// 绑卡支付
export async function paymentByCard(params) {
	try {
		let res = await request({
			url: "/Cards/paymentByCard",
			method: "post",
			params,
		});
		return res;
	} catch (e) {
		return { success: false };
	}
}

// 发送支付验证码
export async function sendPaymentCode(params) {
	try {
		let res = await request({
			url: "/Cards/sendPaymentCode",
			method: "post",
			params,
		});
		return res;
	} catch (e) {
		return { success: false };
	}
}

// 设为 默认支付银行卡
export async function setdefaultcard(params) {
	try {
		let res = await request({
			url: "/Cards/setdefaultcard",
			method: "post",
			params,
		});
		return res;
	} catch (e) {
		return { success: false };
	}
}

// 解绑银行卡
export async function unbindCard(params) {
	try {
		let res = await request({
			url: "/Cards/unbindCard",
			method: "post",
			params,
		});
		return res;
	} catch (e) {
		return { success: false };
	}
}